%{
#include <stdio.h>
#include <stdlib.h>
#include "y.tab.i"
#include "cnf_reader_sintax.hu"
#include "lex.yy.h"
%}

%option yylineno

%%
%bison
%line
%column


"p" {
		return P;
	}

"cnf" {
	return CNF;
	}

[1-9]+[0-9]* { 

		yylval.ival = atoi(yytext);
                return POS_INTEGER;
            }

-[1-9]+[0-9]* { 
		yylval.ival = atoi(yytext);
                return NEG_INTEGER;
            }

"0"           {
                return ZERO;
            }


[ \t\n]         ;       /* ignore whitespace*/

^"c".*\n       { }


.               {char mes[1000]; sprintf(mes, "Unknown character: %s", yytext); yyerror(mes); }
%%
int yywrap(void) {
    return 1;
}

bool set_file(char* file)
{
	yyin=fopen(file,"r+");

	return yyin != NULL;

}
